package Chess;

import Chess.chessPiece;
import Thread.ChessThreadsend;

public class Compile {
	private int chessnumber;
	private String ip;
	public void read(chessPiece chesspiece,int fromx,int fromy,int tox,int toy){
        
		ip = IPlogion.ipwhite;
		if(chesspiece.getChessType()==chessType.whitePawn){
			chessnumber = 1;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}
		else if(chesspiece.getChessType()==chessType.whiteRook){
			chessnumber = 2;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}
		else if(chesspiece.getChessType()==chessType.whiteKnight){
			chessnumber = 3;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}
		else if(chesspiece.getChessType()==chessType.whiteBishop){
			chessnumber = 4;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}
		else if(chesspiece.getChessType()==chessType.whiteQueen){
			chessnumber = 5;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}
		else if(chesspiece.getChessType()==chessType.whiteKing){
			chessnumber = 6;
			new Thread(new ChessThreadsend(ip,chessnumber,fromx,fromy,tox,toy)).start();
		}		
	}
}
